import log from '@dfeidao/atom-nodejs/logger/log';
import operate from '@dfeidao/atom-nodejs/db/operate';
import { systemid } from '../../atom/config';

interface Message {
	filter: {
		_id: string[]
	};
}

export default async function atom(msg: Message, action_id: string, session_id: string) {
	log('Service begin');
	// 删除左侧数据
	const { del, exec } = operate(action_id, session_id, systemid);
	del('risk_point_name', { _id: { $in: msg.filter._id } });

	const res = await exec();
	log('Service end');
	return res;
}
